package com.Adapter;

import com.Model.Database.Database;
import android.content.*;

import android.database.sqlite.*;

public class GolfDbAdapter {
	
	private Context context;

//	private Database mDbHelper;
	
	/**
	 * Constructor This constructor simply stores the context, which is the
	 * owner of the database connection.
	 * 
	 * @param context
	 *            The calling component (e.g. Activity)
	 */
	public GolfDbAdapter(Context context) {
		this.context = context;
	}

	/**
	 * This utility method obtains a database connection.
	 * 
	 * @return An active connection to the database
	 */
	SQLiteDatabase open() {
    	Database helper = new Database(context);
		return helper.getWritableDatabase();
    }
	
	/**
	 * This  method add teams to the database
	 */
	public void addNewTeam (ContentValues values) {
		SQLiteDatabase db = open();
		db.insert("Teams", null, values);
		db.close();
	}
	

}
